<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-09-04 16:18:08
 * @LastEditTime: 2019-09-12 14:52:44
 * @LastEditors: Please set LastEditors
 -->
<template>
  <!--index.wxml-->
  <view class="container">
    <!-- <image id='ig' src="../img/b3504374a0ab8d141b7a546bdf60af1.jpg" mode="widthFix"></image> -->
    <!-- <canvas canvas-id="cavcas" id="cavcas" class="cavcas"></canvas> -->
    <view class="heder">识别结果<text>【批改{{serir.ITRResult.recog_result[0].line_word_result.length||'--'}}题,{{errnum}}题错误】</text></view>
    <view class="stadlist" v-for="(item,index) in serir.ITRResult.recog_result[0].line_word_result" :data-item="item" :key="index" :style="(serir.ITRResult.multi_line_info.imp_line_info[index].total_score?'':'background:red;color:white')">
      <text>{{item.word_content}}</text><image :src="item.src" alt=""></image>
    </view>
  </view>

</template>


<script>
const util = require('../../utils/util.js')
const apis = require('../../utils/api.js')
const app = getApp()
export default {
    data(){
        return {
          serir:{
            ITRResult:{
              recog_result:[{line_word_result:{}}]
            }
          },
          heights:'',
          errnum:''
        }
    },
    onShow:function(){
        if(!wx.getStorageSync('loslist')) return
        this.serir = JSON.parse(wx.getStorageSync('loslist'))
        
        // 题目信息
        console.log(this.serir)
        let info = this.serir.ITRResult.multi_line_info.imp_line_info;
        // 题目识别击鼓而过
        let moifo = this.serir.ITRResult.recog_result[0].line_word_result;
        let k =0;

        for(let i=0;i<info.length;i++){
          info[i].total_score == 1?moifo[i].src = '/static/images/dui.png':(moifo[i].src='/static/images/cuo.png',k++)
          moifo[i].word_content[0] = moifo[i].word_content[0].replace("\\times","*");
          // info[i].total_score == 1? '': k++ 
        }
       
        this.$set(this,'errnum',k)
      }
}
</script>

<style lang="less" scoped>
/* .cavcas{
  display: block !important;
  width: 100%;
  height: 800rpx;
  margin: 0;
  position: absolutel;
  top: -770rpx;
  left:0;
}
image{
  width: 100%;
  height: 770rpx;
} */
.container view:nth-child(2n){
    background: #ccc;
}
.heder{
  width: 90%;
  height: 100rpx;
  line-height: 100rpx;
  margin-left:5%;
}
.heder text{float: right;}
.stadlist{
  width: 100%;
  height: 80rpx;
  line-height: 80rpx;
  padding-left: 60rpx;
  white-space:nowrap;
}
image{
  width: 30rpx;
  height: 30rpx;
  margin-left: 20rpx;
}
</style>

